package com.angel.provider.health.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.angel.core.base.BaseProviderImpl;
import com.angel.dao.health.BuzMedicalContentMapper;
import com.angel.dao.health.BuzSubjectsMapper;
import com.angel.health.BuzMedical;
import com.angel.health.BuzMedicalContent;
import com.angel.health.BuzSubjects;
import com.angel.provider.health.BuzMedicalContentProvider;

@Service
public class BuzMedicalContentProviderImpl extends BaseProviderImpl<BuzMedicalContent> implements BuzMedicalContentProvider{

	@Autowired
	private BuzMedicalContentMapper mapper;
	
	@Autowired
	private BuzSubjectsMapper buzSubjectsMapper;
	
	public BuzMedicalContent findById(Integer id) {
		return mapper.selectByPrimaryKey(id);
	}

	@Override
	public List<BuzSubjects> getAll(Integer medicalId, Integer subjectsId) {
		
		BuzMedical buzMedical = new BuzMedical();
		buzMedical.setId(medicalId);
		
		BuzSubjects buzSubjects = new BuzSubjects();
		buzSubjects.setMedical(buzMedical);
		buzSubjects.setId(subjectsId);
		
		buzSubjects.setEnable(1);
		
		List<BuzSubjects> subjects = buzSubjectsMapper.getAll(buzSubjects);
		
		return subjects;
	}

	/* (non-Javadoc)
	 * @see com.angel.provider.health.BuzMedicalContentProvider#findContentAll(com.angel.health.BuzMedicalContent)
	 */
	@Override
	public List<BuzMedicalContent> findContentAll(BuzMedicalContent medicalContent) {
		// TODO Auto-generated method stub
		return mapper.findContentAll(medicalContent);
	}
	
	

}
